<?php
/*
 * Cree le 13-sept.-2006 21:13:34
 * par ludo
 */

class IndexController extends Zend_Controller_Action {

    public function indexAction() {
        // chargement de la session
        $session = Zend::registry("session");
        $view = Zend::registry("view");
        $view->zendVersion = Zend::compareVersion("0.8.0dev");
        echo $view->render("pageDefault.tpl.php");
    }

    public function __call($action, $arguments) {
        $view = Zend::registry("view");
        $headers = array();
        $headers[] = "Content-Type: text/html; charset=utf-8";
        $headers[] = "HTTP/1.0 404 Page introuvable.";
        $headers[] = "Refresh: 5; URL='"._HTTP_."'";
        $view->headers = $headers;
        $view->title   = "La page demandée n'existe pas!";
        $view->detail  = "Vous allez être redirigé(e) sur la <a href=\""._HTTP_."\" title=\"Page principale\">page principale</a> dans 5 secondes.";
        $view->detail .= "<br /><br /><br />";
        $view->detail .= "<pre><u>Action :</u>\n" . $action . "\n\n<u>Arguments :</u>\n" . $arguments . "</pre>";
        die( $view->render("pageError.tpl.php") );
    }
    public function noRouteAction() {
        $view = Zend::registry("view");
        $headers = array();
        $headers[] = "Content-Type: text/html; charset=utf-8";
        $headers[] = "HTTP/1.0 404 Page introuvable.";
        $headers[] = "Refresh: 5; URL='"._HTTP_."'";
        $view->headers = $headers;
        $view->title   = "La page demandée ne peut pas être trouvée!";
        $view->detail  = "Vous allez être redirigé(e) sur la <a href=\""._HTTP_."\" title=\"Page principale\">page principale</a> dans 5 secondes.";
        die( $view->render("pageError.tpl.php") );
    }

}

?>
